<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var time = parseInt(prompt("请问显示几点了？"));
        if (time > 6 && time <= 12) {
            alert("上午好")
        } else if (time >= 13 && time <= 18) {
            alert("下午好")
        } else if (time >= 19 && time <= 23) {
            alert("晚上好")
        } else if (time >= 0 && time <= 5) {
            alert("这是休息时间，不要说话！")
        }
    </script>
</body>

</html>